package cn.thinkluck.pattern.observier.weather;

/**
 * @Author liutao
 * @DateTime 2024/7/24 下午9:25
 */
public class Main {
    public static void main(String[] args) {
        // 创建天气站主题
        WeatherStation weatherStation = new WeatherStation();
        // 创建客户端观察者
        AppClient appClient = new AppClient();
        WebClient webClient = new WebClient();
        // 注册观察者
        weatherStation.registerObserver(appClient);
        weatherStation.registerObserver(webClient);
        // 改变天气(温度)
        weatherStation.changeTemperature(25.7f);
    }
}
